package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import com.jzo2o.mvc.utils.UserContext;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * description
 *
 * @author yuanguangbin
 * @date 2024/6/5 19:13
 */
@RestController("workerworkerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@ApiOperation("服务端-服务人员认证审核接口")
public class WorkerCertificationAuditController {

    @Resource
    private IWorkerCertificationAuditService workercertificationAuditService;


    @PostMapping
    @ApiOperation("提交认证申请")
    public void auditCertification(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO){
        workerCertificationAuditAddReqDTO.setServeProviderId(UserContext.currentUserId());
        workercertificationAuditService.applyCertification(workerCertificationAuditAddReqDTO);

    }


    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO queryRejectReason(){
        return workercertificationAuditService.queryCurrentUserLastRejectReason();
    }





}
